/**
	License:		Artistic license 2.0 (see license.txt, also available online at http://www.perlfoundation.org/artistic_license_2_0)
	Authors:		OrbitalLab (http://www.orbitallab.ru/moonglide/), 2007-2009

	File:			IRendererOffscreen.d
	Description:	offscreen render manager
	Date:			08.02.2008 by Jurec
*/
module moonglide.renderer.IRendererOffscreen;

public import
	moonglide.resources.resobjects.hilevel.ResTexture,
	moonglide.scenes.rendertarget.Main;

// wrapper for FBO
interface IRenderTarget
{
    public:

        bool hasStencil ();
        bool hasDepth ();

        // check fbo
        bool	isOk   ();
        // create of all 3d objects
        bool	create ();

        bool	bind   ();
        bool	unbind ();

        // (no - number of attachment - if use FBO)
        bool attachColorTexture (CResTexture tex, int no=0);
   //     bool attachColorTextureCubeMap (CResTexture tex, ETexTarget cubeMapSide, int no=0);

        // if use FBO
   //     bool attachDepthTexture ( CResTexture tex );
   //     bool attachDepthTextureCubeMap (CResTexture tex, ETexTarget cubeMapSide);

        bool detachColorTexture (uint target, int no=0);
        bool detachDepthTexture (uint target);

        // multi render target
        bool setMRT (int targetsCount, uint * targets);

        // get pointer to attached texture
     //   CResTexture getRenderTarget (int no=0);
     //   CResTexture getDepthTarget ();

}


//================================================================
/// manager for offscreen rendering
//===============================================================
interface IOffscreenManager
{

        IRenderTarget createRenderTarget( CResTexture _for );

		void setRenderTarget( IRenderTarget target );

}
